import java.util.ArrayList;

public class Oliphant extends Piece {
	/*
	 * 8   - - - - - x - - - - - -    
	 * 7   - - - - - x - - - - - -    
	 * 6   - - - - - x - - - - - -    
	 * 5   x x x x x O x x x x x x    
	 * 4   - - - - - x - - - - - -      EARTH (2)
	 * 3   - - - - - x - - - - - -    
	 * 2   - - - - - x - - - - - -    
	 * 1   - - - - - x - - - - - -    
	 * 	   a b c d e f g h i j k l
	 * 
	 * The Oliphant stays on the EarthBoard and is just like a rook in regular chess!
	 */
	
	public Oliphant(int s) {
		super(s);
	}

	protected ArrayList<Square> getAvailableMoves() {
		moves.clear();
		for(int i = 1; i < 8; i++) {
			moves.add(getSquare().getFarSquare(Square.NORTH, i));
			if (moves.get(moves.size() - 1).isOccupied()){
				i += 8;
			}
		}
		for(int i = 1; i < 12; i++) {
			moves.add(getSquare().getFarSquare(Square.EAST, i));
			if (moves.get(moves.size() - 1).isOccupied()){
				i += 12;
			}
		}
		for(int i = 1; i < 8; i++) {
			moves.add(getSquare().getFarSquare(Square.SOUTH, i));
			if (moves.get(moves.size() - 1).isOccupied()){
				i += 8;
			}
		}
		for(int i = 1; i < 12; i++) {
			moves.add(getSquare().getFarSquare(Square.WEST, i));
			if (moves.get(moves.size() - 1).isOccupied()){
				i += 12;
			}
		}
		System.out.println(moves);
		return moves;
	}
	
	protected ArrayList<Square> getAvailableCapts() {
		return getAvailableMoves();
	}
	
	public String toString() {
		if(side == 1) {
			return "O";
		} else if(side == 2) {
			return "o";
		} else {
			return "no side";
		}
	}
}
